package pak

import (
	"github.com/c-bata/go-prompt"
	_ "github.com/go-sql-driver/mysql"
)

func Completer(d prompt.Document) []prompt.Suggest {
	suggests := []prompt.Suggest{
		{Text: "SELECT", Description: "查询数据"},
		{Text: "INSERT", Description: "插入数据"},
		{Text: "UPDATE", Description: "更新数据"},
		{Text: "DELETE", Description: "删除数据"},
		{Text: "SHOW", Description: "查看数据库或表"},
		{Text: "SET", Description: "设置键值对"},
		{Text: "GET", Description: "获取键值"},
		{Text: "HSET", Description: "哈希表操作"},
		{Text: "LPUSH", Description: "列表操作"},
	}
	return prompt.FilterHasPrefix(suggests, d.GetWordBeforeCursor(), true)
}
